// JavaScript Document
var myStage,ozd1,ozd2,ozd3,dfj1,dfj2,dfj3,dfjb1,dfjb2,dfjb3;
var Zdtimer=null;
var Djtimer=null;
function dom() {
	myStage = new createjs.Stage("wt");
	var bg = {//背景
		"images":["images/bg1.png"],
		"frames":{"height":2400,"width":400,"count":1,"regX":0,"regY":0},
		"animations":{"stand":0},
	}
	
	
	var data = {//myfj
		"images":["images/大爆炸.png"],
		"frames":{"height":90,"width":100,"count":12,"regX":0,"regY":0},
		"animations":{"boo":[0,10],"myplane":[11]},
	}
	
	
		var zd1 = {
		"images":["images/zd2.png"],
		"frames":{"height":60,"width":33,"count":2,"regX":0,"regY":0},
		"animations":{"biu":[0,0]},
	}
		var zd2 = {
		"images":["images/zd2.png"],
		"frames":{"height":60,"width":33,"count":2,"regX":0,"regY":0},
		"animations":{"biu":[0,0]},
	}
		var zd3 = {
		"images":["images/zd2.png"],
		"frames":{"height":60,"width":33,"count":2,"regX":0,"regY":0},
		"animations":{"biu":[0,0]},
	}
	
	
	
		var odj1={
		"images":["images/dj.png"],
		"frames":{"height":90,"width":100,"count":12,"regX":0,"regY":0},
		"animations":{"dfjboo":[0,10],"dj":[11]},
		}
		var odj2={
		"images":["images/dj.png"],
		"frames":{"height":90,"width":100,"count":12,"regX":0,"regY":0},
		"animations":{"dfjboo":[0,10],"dj":[11]},
		}
		var odj3={
		"images":["images/dj.png"],
		"frames":{"height":90,"width":100,"count":12,"regX":0,"regY":0},
		"animations":{"dfjboo":[0,10],"dj":[11]},
		}
		
		
	var Odj1 = new createjs.SpriteSheet(odj1);
	dfj1 = new createjs.Sprite(Odj1,"dj");
	
	var Odj2 = new createjs.SpriteSheet(odj2);
	dfj2 = new createjs.Sprite(Odj2,"dj");

	var Odj3 = new createjs.SpriteSheet(odj3);
	dfj3 = new createjs.Sprite(Odj3,"dj");
		
		
	var Zd1 = new createjs.SpriteSheet(zd1);
	ozd1 = new createjs.Sprite(Zd1,"biu");
	
	var Zd2 = new createjs.SpriteSheet(zd2);
	ozd2 = new createjs.Sprite(Zd2,"biu");

	var Zd3 = new createjs.SpriteSheet(zd3);
	ozd3 = new createjs.Sprite(Zd3,"biu");

		ozd1.y=999;
		ozd1.x=999;
		ozd2.y=999;
		ozd2.x=999;
		ozd3.y=999;
		ozd3.x=999;

	
	
	var Bg = new createjs.SpriteSheet(bg);
	obg = new createjs.Sprite(Bg,"stand");
	myStage.addChild(obg);
	obg.y=-1520;
	
	var SpSh = new createjs.SpriteSheet(data);
	fj = new createjs.Sprite(SpSh,"myplane");
	fj.y=700;
	fj.x=300;
	
	
	myStage.addChild(fj);
	
	createjs.Ticker.addEventListener("tick",tick);
	function tick(){
		bgmove();
		fjdie();
		dfjdie();
		myStage.update();};
		
	myStage.addEventListener("stagemousemove",move);
	myStage.addEventListener("stagemousedown",handleClick);
	function handleClick(){
		if (z1==false)
		{
			zd1m();
		}
		else if(z2==false)
		{
			zd2m();
		}
		else if(z3==false)
		{
			zd3m();
		}
	}
	

	/*Zdtimer=setTimeout(function(){//子弹3个
		setTimeout(function(){zd1m()},1000);	
		setTimeout(function(){zd2m()},2500);
		setTimeout(function(){zd3m()},4000);
		},100)*/

	Djtimer=setTimeout(function(){//敌机3个
		setTimeout(function(){djs1()},djspeed1);
		setTimeout(function(){djs2()},djspeed1);
		setTimeout(function(){djs3()},djspeed1);
		},djspeed2)

	
	}
	